﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Wyn.PMS.Common.Utils;
using Wyn.PMS.Entity.Entities;

namespace Wyn.PMS.Common.NightAudit
{
    public class ReasonHelper
    {
       
        public const string REASON_PARENT_KEY = "WR";

        public static IEnumerable<DictKeyValue> GetReasons(string reasonType)
        {
            var codes = BizCodeCache.GetBizCode(GlobalConst.ROOT_HOTEL_ID, REASON_PARENT_KEY);

            IEnumerable<DictKeyValue> result = null;

            if(codes!=null && codes.Any())
            {
                result = codes.Where(r => r.KeyValue.Contains(reasonType)).ToList();
            }

            return result;
        }
    }
}
